package com.leyou.item.mapper;

import com.leyou.common.base.BaseMapper;
import com.leyou.item.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {
    int insertBrandCategory(@Param("cids") List<Long> cids,@Param("id") Long id);

    @Select("select b.id,b.name,b.image,b.letter from tb_brand b INNER JOIN tb_category_brand cb" +
            " on b.id=cb.brand_id where cb.category_id=#{cid}")
    List<Brand> selectByCategoryId(@Param("cid") Long cid);
}
